<!--
+----------------------------------------------------------------------
| 友得云客  - 开启房产营销新纪元
+----------------------------------------------------------------------
| Copyright (c) 2019~2023 优得（西安）信息科技有限公司版权所有
+----------------------------------------------------------------------
| Licensed 友得云客不是自由软件 未经允许不可移除相关版权
+----------------------------------------------------------------------
| Author: www.youdeyunke.com
+----------------------------------------------------------------------
-->
<template>
    <div class="form" v-cloak v-if="data">
        <el-form-item label="图片">
            <el-button icon="el-icon-picture-outline" size="mini" @click="changeImage">替换图片</el-button>
        </el-form-item>

        <el-form-item label="跳转">
            <link-editor v-model="data.link"></link-editor>
        </el-form-item>

        <el-form-item label="备注">
            <el-input style="width:200px;" v-model="data.title" placeholder></el-input>
        </el-form-item>

        <media-manager ref="mm" :show.sync="showMM" :limit="1" :file-types="['image']" @selected="imageChange" />
    </div>
</template>

<script>
import MediaManager from "@/components/MediaManager/Index";
import LinkEditor from "@/components/LinkEditor";
export default {
    components: { LinkEditor, MediaManager, },
    data () {
        return {
            showMM: false,
            loading: false,
        };
    },
    props: {
        data: { type: Object, default: null },
    },

    mounted: function () { },

    computed: {},

    methods: {
        changeImage: function () {
            // 修改图片
            this.showMM = true
        },
        imageChange: function (imgs) {
            this.data.url = imgs[0].url
        },

    },
};
</script>

<style scoped></style>